home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-09 | 1.3 KB | 33 lines | [TEXT/GEOL] |
- Item 2643816 5-March-90 09:37PST
-
- From: WILSON6 Wilson, Dave-Personal Concepts,VCA
-
- To: POWERUP.DEV Power Up Software,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: Model/View
-
- James,
-
- In Smalltalk-80, the Object in class in Smalltalk keeps dependents in a class
- variable. Furthermore, it has a Model class that is a subclass of Object with a
- "dependents" instance variable that can be used to keep track of a collection
- of views on that model. Each View has a "model" instance variable to point to
- its model.
-
- Typically, when you change the data in a model object, it sends itself the
- message "changed". The changed method sends the update message to each
- dependent object (with parameters telling what aspect of the model changed if
- you wish).
-
- As an example, if the name of your TCustomer object changed and it were a
- subclass of Model, it could send itself the changed message, passing name as a
- parameter. This would cause your TCustomerInvoiceView and TCustomerSummaryView
- objects to get the Update message with name as a parameter. Your Update
- methods could then invalidate the relevant part of their views. I have
- oversimplified this a bit, but that is the basic idea.
-
- Dave
-
-